#pragma once

#include "Control.h"

namespace mgui
{
	class OnOffButton : public Control
	{
	public:
		OnOffButton(const Rect & bounds, const std::string & text = "", bool exclusiveWhenEnabled = false);

		static const int EVENT_STATE_CHANGED = 0;
		static const int EVENT_MOUSE_DRAGGED = 1;

		std::string Text;
		bool Enabled;

		bool ExclusiveWhenEnabled;

	private:
		virtual void drawSelf();
		virtual bool processLButtonUpInside(const Point & pt);
		virtual bool processLButtonUpOutside(const Point & pt);
		virtual bool processLButtonDownInside(const Point & pt);
		virtual bool processLButtonDownOutside(const Point & pt);

		virtual bool processMouseMovedInside(const Point & pt);
		virtual bool processMouseMovedOutside(const Point & pt);

		bool processMouseMoved(const Point & pt);

		bool mIsExclusive;

		bool mDragging;
		Point mPrevMousePos;
	};
}